@extends('master')

@section('title', '新闻管理')

@section('content')
<div class="row">
    <div class="col-md-12">
        @include('message')
        <p class="lead">
            新闻编辑
        </p>
    </div>
</div>
<div class="row">
    <% Form::model($news, array('route' => array('admin.news.update', $news->id), 'method' => 'PUT', 'files' => true)) %>
    <div class="col-md-9">
        <div class="form-group">
            <% Form::text('title', $news->title, array('class' => 'form-control input-lg', 'placeholder' => '新闻标题')) %>
            <%$errors->first('title', '<p class="help-block"><span class="text-danger">:message</span></p>') %>
        </div>
        <div class="form-group">
            <% Form::textarea('content', $news->content, array('class' => 'form-control')) %>
            <% $errors->first('content', '<p class="help-block"><span class="text-danger">:message</span></p>') %>
        </div>
    </div>
    <div class="col-md-3">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">
                    更新
                </h3>
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label for="news_status" class="control-label">新闻状态</label>
                    <% Form::select('status', array('0' =>'草稿', '1' => '发布'), $news->status, array('class' => 'form-control')) %>
                    <% $errors->first('status', '<p class="help-block"><span class="text-danger">:message</span></p>') %>
                </div>
                <button class="btn btn-info btn-md pull-right">更新</button>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">
                    简介
                </h3>
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label for="news_intro" class="control-label">*简介</label>
                    <% Form::text('intro', $news->intro, array('class' => 'form-control')) %>
                    <% $errors->first('intro', '<p class="help-block"><span class="text-danger">:message</span></p>') %>
                </div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">
                    特色图片
                </h3>
            </div>
            <div class="panel-body">
                <div class="form-group text-center">
                    <label for="news_thumbnail" class="control-label">新闻缩略图</label>
                    <% Form::file('thumbnail', array('class' => 'form-control')) %>
                    <p class="help-block">建议上传正方形的缩略图</p>
                    <% HTML::image($news->thumbnail, null, array('width' => '150px')) %>
                    <% $errors->first('thumbnail', '<p class="help-block"><span class="text-danger">:message</span></p>') %>
                </div>
            </div>
        </div>
    </div>
    <% Form::close() %>
</div>

@stop